#pragma once

#include "fxcc/core/graph/directX11/pch.h"

namespace fxcc
{
    namespace graph
    {
        namespace directX11
        {
            struct FXCC_API Texture2DJack : public fxcc::graph::common::Texture2DJack
            {
                Texture2DJack(const fxcc::graph::common::Texture2DJack::Desc& desc);

                void Load();

                bool Init();

                bool InitWIC();

                bool InitDDS();

                bool InitAlloc();

                void VSSet(int startSlot, int numSlot = 1);

                void PSSet(int startSlot, int numSlot = 1);

                bool CreateFromImage(const fxcc::graph::common::ImageMipmap::MipMapData& mipMapData);

                ComPtr<ID3D11ShaderResourceView> m_ShaderResourceView;
                
                ComPtr<ID3D11Texture2D> m_Texture2D;

                ComPtr<ID3D11RenderTargetView> m_RenderTargetView;

                ComPtr<ID3D11DepthStencilView> m_DepthStencilView;

                ImTextureID GetTextureId() const override{
                    
                    return (ImTextureID)m_ShaderResourceView.Get();
                }
            };
        };
    }
};